/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package data.pojo;

import java.io.Serializable;
import java.util.List;

/**
 *
 * @author 伯乐
 */
public class Customer implements Serializable {

    String id; //唯一标识id
    String name; //姓名
    String password; //密码
    int points; //积分
    List<Order> orderList;
    List<Collection> collections;
    
    public void setPassword(String password) {
        this.password = password;
    }
    
    public void setId(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    }
    

    public void setOrderList(List<Order> orderList) {
        this.orderList = orderList;
    }

    public List<Order> getOrderList() {
        return orderList;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setPaasword(String paasword) {
        this.password = paasword;
    }

    public int getPoints() {
        return points;
    }

    public void setPoints(int points) {
        this.points = points;
    }

    public List<Collection> getCollections() {
        return collections;
    }

    public void setCollections(List<Collection> collections) {
        this.collections = collections;
    }

    public String getPassword() {
        return password;
    }
    
    public boolean addPoints(int pI) {
        if (points + pI >= 0) {
            points += pI;
            return true;
        } else {
            return false;
        }
    }

    public void resetPoints(int pI) {  //重置积分为pI
        if (pI >= 0) {
            points = pI;
        }
    }

    public void addCollection(Collection col) {
        collections.add(col);
    }

    public void addOrder(Order order) {
        orderList.add(order);
    }
}
